package com.ruoyi.crm.mapper;

import com.ruoyi.crm.domain.CrmContract;
import com.ruoyi.crm.domain.CrmOrder;
import com.ruoyi.crm.domain.CrmOrderCollectPayMoney;
import com.ruoyi.crm.domain.dto.CrmContractDTO;
import com.ruoyi.crm.domain.dto.CrmProjectDTO;
import com.ruoyi.crm.domain.dto.CrmStatisticsSearchDTO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author YanWenliang
 * @date 2024/12/20 10:11
 * @desciption:
 */
public interface CrmDataStatisticsMapper {

    /**
     * 获取商机数量以及待续费数量
     * @param userId
     * @return
     */
    Map<String, Integer> getOrderAndIsRenewalCount(String userId);

    /**
     * 统计合同金额
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getContractMoneySum(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计90，60，30，预计利润，预计提成
     * @param crmStatisticsSearchDTO
     * @return
     */
    Map<String, BigDecimal> getPerformance(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 计算预计利润和预计提成
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getProfitAndCommission(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 计算实际利润
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getRealProfit(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计实际支出数据
     * @param crmStatisticsSearchDTO
     * @return
     */
    Map<String, BigDecimal> statisticsActualSpending(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计待办数据数量
     * @param crmStatisticsSearchDTO
     * @return
     */
    Map<String, Integer> getOrderCountGroupProgess(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计应收未收
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getCollectionAmt(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计应收未收
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getPayAmt(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 销售额排行
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmContractDTO> statisticsSales(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 成交次数客户排行
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmContractDTO> statisticsTransactionsCount(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计商机数量、待续费列表数据
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmOrder> getOrderAndIsRenewalList(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 统计合同列表
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmProjectDTO> getContractMoneySumList(CrmStatisticsSearchDTO crmStatisticsSearchDTO);


    /**
     * 统计90，60，30 数据列表
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmOrder> getPerformanceList(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 收款列表
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmOrderCollectPayMoney> getCollectionAmtList(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 付款列表
     * @param crmStatisticsSearchDTO
     * @return
     */
    List<CrmOrderCollectPayMoney> getPayAmtList(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 计算回款
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getPayment(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

    /**
     * 固定支出
     * @param crmStatisticsSearchDTO
     * @return
     */
    BigDecimal getFixedPayout(CrmStatisticsSearchDTO crmStatisticsSearchDTO);

}
